<template>
	<view class="yiquan">
		<view class="box" v-for="item,index in list" :key="index" @click="goDetails(item)">
			<view class="diyihan">
				{{item.shotMsg}}
			</view>
			<view class="xmian">
				<view class="zhou">
					<view class="liulna">
						<view class="liulanrsh">
							<view class="huise">
								浏览人数：
							</view>
							<view class="heis">
								{{item.viewers}}
							</view>
						</view>
						<view class="lxsra">
							<view class="huise">
								联系人数：
							</view>
							<view class="heis">
								{{item.contacts}}
							</view>

						</view>
					</view>
					<view class="rqi">
						<view class="huise">
							发布日期：
						</view>
						<view class="heis">
							{{item.createTime}}
						</view>
					</view>
					<view class="rqi">
						<view class="huise">
							帖子状态：
						</view>
						<view class="heis">
							{{item.createTime}}
						</view>
					</view>
				</view>
			</view>
			<view class="quxioa" @click="qxCollection(item.id)">
				取消收藏
			</view>
		</view>
	</view>
	<up-empty v-if="list.length<=0" mode="list"></up-empty>
</template>

<script>
	import {
		myCollection,
		infClearCollection
	} from "@/request/api.js"
	export default {
		data() {
			return {
				list: []
			}
		},
		onShow() {
			this.mCollection()
		},
		methods: {
			goDetails(e) {
				uni.navigateTo({
					url: '../details/index?detalis=' + JSON.stringify(e)
				})
			},
			mCollection() {
				myCollection().then(res => {
					console.log(res);
					this.list = res.result
				})
			},
			qxCollection(e) {
				infClearCollection(e).then(res => {
					console.log(res);
					uni.showToast({
						title: res.message,
						icon: "none"
					})
					this.mCollection()
				})
			}
		},
	}
</script>
<style>
	page {
		background-color: #fafafa;
	}
</style>
<style scoped lang="less">
	.quxioa {
		position: absolute;
		bottom: 42rpx;
		right: 24rpx;
		width: 153rpx;
		height: 64rpx;
		background: #F8492E;
		border-radius: 16rpx 16rpx 16rpx 16rpx;

		font-weight: 400;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 64rpx;
		text-align: center;
		font-style: normal;
		text-transform: none;
	}

	.yiquan {
		width: 702rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		box-sizing: border-box;

		.box {
			padding: 20rpx;
			border-radius: 13rpx 13rpx 13rpx 13rpx;
			background: #fff;
			margin-bottom: 20rpx;
			position: relative;
		}

		.diyihan {
			width: 654rpx;
			height: 38rpx;
			white-space: nowrap;
			/* 禁止换行 */
			overflow: hidden;
			/* 超出宽度隐藏 */
			text-overflow: ellipsis;
			/* 显示省略号 */

			font-weight: 400;
			font-size: 28rpx;
			color: #333333;
			font-style: normal;
			text-transform: none;
		}

		.xmian {
			display: flex;
			margin-top: 32rpx;
			justify-content: space-between;
			align-items: flex-end;

			.zhou {
				.liulna {
					display: flex;


					.liulanrsh {
						display: flex;
						margin-right: 72rpx;
					}

					.lxsra {
						display: flex;
					}
				}

				.rqi {
					display: flex;
					margin-top: 20rpx;
					margin-bottom: 20rpx;
				}

				.ztai {
					display: flex;

					.zhuangtao1 {

						font-weight: 400;
						font-size: 24rpx;
						color: #AAAAAA;
						font-style: normal;
						text-transform: none;
					}

					.ztaihon {

						font-weight: 400;
						font-size: 24rpx;
						color: #F8492E;

						font-style: normal;
						text-transform: none;
					}
				}
			}

			.you {
				width: 153rpx;
				height: 64rpx;
				background: #F8492E;
				border-radius: 16rpx 16rpx 16rpx 16rpx;

				font-weight: 400;
				font-size: 24rpx;
				color: #FFFFFF;
				line-height: 62rpx;
				text-align: center;
				font-style: normal;
				text-transform: none;
			}
		}

	}

	.huise {

		font-weight: 400;
		font-size: 24rpx;
		color: #AAAAAA;
		font-style: normal;
		text-transform: none;
	}

	.heis {

		font-weight: 400;
		font-size: 24rpx;
		color: #333333;
		font-style: normal;
		text-transform: none;
	}
</style>